<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改告警设置')" />
	<th:block th:include="include :: select2-css" />
</head>
<body>
    <div class="form-content" style="width: 100%;">
        <form class="form-horizontal" id="form-alert-config-edit" th:object="${alermConfigInfo}">
            <h4 class="form-header h4">基本信息</h4>
            <input name="stationId" autocomplete="off" id="stationId"  class="form-control" type="hidden" th:value="*{stationId}">
            <input name="id" autocomplete="off"  class="form-control" type="hidden"  th:field="*{id}">
            <div class="row">
            	 
                <div class="col-sm-7">
                 <div class="form-group">
                 		<label class="col-sm-4 control-label"><span style="color: red; ">*</span>泵站名称：</label>
                        <div class="col-sm-8">
                            <div class="input-group">
                                <input class="form-control" type="text" name="stationName" onclick="selectPumpStationNoUse()" id="stationName" th:field="*{stationName}" required="required">
                            	<span class="input-group-addon"><i class="fa fa-search"></i></span>
                            </div>
                        </div>
                    </div>
                </div>
                
            </div>
            <div class="row">
                <div class="col-sm-7">
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><span style="color: red; ">*</span>高阈值：</label>
                        <div class="col-sm-8">
                            <input name="highThreshold" autocomplete="off" placeholder="请输入高阈值" class="form-control" type="number" th:field="*{highThreshold}"  required>
                        </div>
                    </div>
                </div>
                <div class="col-sm-7">
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><span style="color: red; ">*</span>低阈值：</label>
                        <div class="col-sm-8">
                            <input name="lowThreshold" autocomplete="off" class="form-control" type="number"  placeholder="请输入低阈值" th:field="*{lowThreshold}" required>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
            
             <div class="col-sm-7">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">类型：</label>
                        <div class="col-sm-8">
                         <div class="input-group " style="width: 100%">
                                <select name="type" class="form-control m-b" th:field="*{type}" th:with="type=${@dict.getType('biz_alerm_config_type')}">
				                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" ></option>
				                </select>
                          </div>
                        </div>
                    </div>
                </div>
            
                <div class="col-sm-7">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">属性类型：</label>
                        <div class="col-sm-8">
                         <div class="input-group " style="width: 100%">
                                <select name="fieldType" class="form-control m-b"  th:field="*{fieldType}" th:with="type=${@dict.getType('biz_alerm_field_type')}">
				                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" ></option>
				                </select>
                          </div>
                        </div>
                    </div>
                </div>
                
                <div class="col-sm-7">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">是否报警静音 ：</label>
                        <div class="col-sm-8">
                         <div class="input-group " style="width: 100%">
                                <select name="isMute" class="form-control m-b" th:with="type=${@dict.getType('biz_is_mute')}" th:field="*{isMute}">
				                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" ></option>
				                </select>
                          </div>
                        </div>
                    </div>
                </div>
                
            </div>
            
            <div class="row">
                <div class="col-sm-7">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">是否有效：</label>
                        <div class="col-sm-8">
                         <div class="input-group " style="width: 100%">
                                <select name="isValid" class="form-control m-b" th:field="*{isValid}" th:with="type=${@dict.getType('biz_is_valid')}">
				                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" ></option>
				                </select>
                          </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <h4 class="form-header h4">其他信息</h4>
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-xs-2 control-label">备注：</label>
                        <div class="col-xs-10">
                            <textarea name="remark" autocomplete="off" maxlength="500" th:field="*{remark}" class="form-control" rows="3"></textarea>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
    
    
    
       <!--  <div class="col-sm-offset-5 col-sm-10">
            <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
        </div>
     -->
    
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: select2-js" />
	<script type="text/javascript">
        var prefix = ctx + "biz/alerm/config";
        
      
        
        function submitHandler() {
	        if ($.validate.form()) {
	        	var data = $("#form-alert-config-edit").serializeArray();
	        	$.operate.save(prefix + "/edit", data);
	        }
	    }
        
        
        function selectPumpStationNoUse() {
            var url = ctx + "biz/pumpStation/selectPumpStationNoUse?alerFlag=1";
		    var options = {
				title: '选择泵站',
				width: "380",
				url: url,
				callBack: doPumpStationSubmit
			};
			$.modal.openOptions(options);
		}
		
		function doPumpStationSubmit(index, layero){
			var tree = layero.find("iframe")[0].contentWindow.$._tree;
			var body = layer.getChildFrame('body', index);
			$("#stationId").val(body.find('#psId').val());
			$("#stationName").val(body.find('#stationName').val());
			layer.close(index);
		}
       

    </script>
</body>
</html>